library(magrittr)
library(tidyverse)
library(Seurat)
library(readxl)
library(cowplot)
library(colorblindr)
library(viridis)
library(ComplexHeatmap)
library(grid)

coi <- params$cell_type_super
cell_sort <- params$cell_sort
cell_type_major <- params$cell_type_major
louvain_resolution <- params$louvain_resolution
louvain_cluster <- params$louvain_cluster
pcut <- params$pcut

# p1 <- ggplot(data.frame(x = 1:5, y = 1:5), aes(x, y)) + geom_point()
# vp_outer <- viewport(x = 0.5, y = 0.5, width = 0.5, height = 0.5, angle = 90)
# vp_inner <- viewport(x = 0.5, y = 0.5, width = 1, height = 1, angle = 0)
# grid.newpage()
# pushViewport(vp_outer)
# grid.rect()
# print(p1, vp = vp_inner)
# popViewport(1)
# g1 <- grid.grab()
# ggdraw() + draw_grob(g1)
## load global vars: 
source("_src/global_vars.R")

# meta_tbl
# clrs
# markers_v7
# markers_v7_super
# cell_type_super_lookup
myfeatures <- c("UMAP_1", "UMAP_2", "umapharmony_1", "umapharmony_2", "sample", "doublet", "nCount_RNA", "nFeature_RNA", "percent.mt", "doublet_score", "cell_type", "cluster_label_sub")

seu_obj_sub <- read_rds("/work/shah/uhlitzf/data/SPECTRUM/freeze/v7/T.super_processed_filtered_annotated.rds")

marker_tbl <- read_tsv("/work/shah/uhlitzf/data/SPECTRUM/freeze/v7/supplementary_tables/T.super_marker_table_annotated_full.tsv")

marker_tbl_top <- marker_tbl %>% 
  filter(avg_logFC > 0.5,
         p_val_adj < 0.01,
         pct.1 > 0.2,
         pct.2 < 0.8,
         !is.na(cluster_label_sub),
         !str_detect(gene, "^RPS|^RPL")) %>% 
  group_by(cluster_label_sub) %>% 
  slice(1:50)

marker_sheet <- read_tsv("/work/shah/uhlitzf/data/SPECTRUM/freeze/v7/supplementary_tables/T.super_marker_sheet_full.tsv")

my_subtypes <- names(clrs$cluster_label_sub[[coi]])

plot_data_sub <- as_tibble(FetchData(seu_obj_sub, c(myfeatures))) %>% 
  left_join(meta_tbl, by = "sample") %>% 
  mutate(cell_type_super = cell_type_super_lookup[cell_type]) %>% 
  mutate(sort_short = str_remove_all(sort_parameters, "singlet, live, ")) %>% 
  mutate(sort_short_x = ifelse(sort_short == "U" & cell_type_super == "Immune", 
                               "CD45+", ifelse(sort_short == "U" & cell_type_super == "Stromal", "CD45-", sort_short))) %>% 
  mutate(cluster_label_sub = ordered(cluster_label_sub, levels = names(clrs$cluster_label_sub[[coi]])))
  
plot_data_sub <- filter(plot_data_sub, sort_short_x == cell_sort, !is.na(tumor_supersite))

0.1 UMAP

alpha_lvl <- ifelse(nrow(plot_data_sub) < 20000, 0.2, 0.1)
pt_size <- ifelse(nrow(plot_data_sub) < 20000, 0.2, 0.05)

common_layers_disc <- list(  
  ggrastr::geom_point_rast(size = pt_size, alpha = alpha_lvl, raster.dpi = 150),
  NoAxes(),
  guides(color = guide_legend(override.aes = list(size = 2, alpha = 1))),
  labs(color = ""),
  theme(aspect.ratio = 1)
)

common_layers_cont <- list(  
  ggrastr::geom_point_rast(size = pt_size, alpha = alpha_lvl, raster.dpi = 150),
  NoAxes(),
  scale_color_gradientn(colors = viridis(9)),
  guides(color = guide_colorbar())
)

umap_coord_anno <- function(size) {
  ggplot(tibble(group = c("UMAP1", "UMAP2"),
                x = c(0, 0), xend = c(1, 0),
                y = c(0, 0), yend = c(0, 1),
                lx = c(0.5, -0.15), ly = c(-0.15, 0.5),
                angle = c(0, 90))) +
    geom_segment(aes(x, y, xend = xend, yend = yend, group = group),
                 arrow = arrow(angle = 20, type = "closed", length = unit(0.1, "npc")),
                 size = size/4, lineend = "round") +
    geom_text(aes(lx, ly, label = group, angle = angle), size = size) +
    theme_void() +
    coord_fixed(xlim = c(-0.3, 1), ylim = c(-0.3, 1))
}

add_umap_coord <- function(gg_obj, x = 0, y = 0, width = 0.3, height = 0.3, size = 4.5) {
  p <- ggdraw() + 
    draw_plot(gg_obj, x = 0, y = 0, width = 1, height = 1) +
    draw_plot(umap_coord_anno(size = size), x = x, y = y, width = width, height = height)
  return(p)
}
plot_data_label <- plot_data_sub %>% 
  group_by(cluster_label_sub) %>% 
  summarise(umapharmony_1 = median(umapharmony_1),
            umapharmony_2 = median(umapharmony_2)) %>% 
  mutate(cluster_number = as.numeric(cluster_label_sub))

umap_cell_type <- ggplot(plot_data_sub, aes(umapharmony_1, umapharmony_2, color = cluster_label_sub)) + 
  common_layers_disc +
  #facet_wrap(~cluster_label_sub) + 
  geom_point(aes(umapharmony_1, umapharmony_2), color = "white",
             data = plot_data_label, alpha = 0.5, size = 6) +
  geom_text(aes(umapharmony_1, umapharmony_2, label = cluster_number), color = "black",
             data = plot_data_label) +
  scale_color_manual(values = clrs$cluster_label_sub[[coi]], labels = str_remove_all(names(clrs$cluster_label_sub[[coi]]), "functional|ivated")[-4]) +
  guides(color = guide_legend(override.aes = list(size = 2, alpha = 1), nrow = 12))

umap_site <- ggplot(plot_data_sub, aes(umapharmony_1, umapharmony_2, color = tumor_supersite)) + 
  common_layers_disc +
  scale_color_manual(values = clrs$tumor_supersite)

umap_cell_type_void <- umap_cell_type + guides(color = F)
umap_site_void <- umap_site + guides(color = F)

umap_cell_type_legend <- cowplot::get_legend(umap_cell_type)
umap_site_legend <- cowplot::get_legend(umap_site)

0.2 module heatmap

module_names <- grep("pathway|CD8", colnames(seu_obj_sub@meta.data), value = T)

plot_data_modules <- as_tibble(FetchData(seu_obj_sub, c(myfeatures, module_names))) %>% 
  gather(pathway, value, -c(1:length(myfeatures))) %>% 
  left_join(meta_tbl, by = "sample") %>% 
  mutate(cell_type_super = cell_type_super_lookup[cell_type]) %>% 
  mutate(sort_short = str_remove_all(sort_parameters, "singlet, live, ")) %>% 
  mutate(sort_short_x = ifelse(sort_short == "U" & cell_type_super == "Immune", 
                               "CD45+", ifelse(sort_short == "U" & cell_type_super == "Stromal", "CD45-", sort_short))) %>% 
  mutate(cluster_label_sub = ordered(cluster_label_sub, levels = names(clrs$cluster_label_sub[[coi]]))) %>% 
  mutate(key_group = ifelse(str_detect(pathway, "pathway"), "pathway", "module")) %>% 
  mutate(pathway = str_remove_all(pathway, ".pathway|.module")) %>% 
  mutate(cluster_label_super = case_when(
    str_detect(cluster_label_sub, "^CD4") ~ "CD4",
    str_detect(cluster_label_sub, "^CD8") ~ "CD8",
    str_detect(cluster_label_sub, "^NK") ~ "NK",
    str_detect(cluster_label_sub, "^Cycling") ~ "Cycling",
    T ~ "Other"
    )) %>% 
  mutate(cluster_label_super = ordered(cluster_label_super, levels = c("CD4", "CD8", "Other", "NK", "Cycling")))
  
plot_data_modules <- filter(plot_data_modules, sort_short_x == cell_sort, !is.na(tumor_supersite))

plot_data_modules_summary_sample <- plot_data_modules %>% 
  group_by(pathway, key_group, sample, patient_id_short, cluster_label_sub, cluster_label_super) %>% 
  summarise(mean_score = mean(value, na.rm = T)) %>% 
  ungroup

plot_data_modules_summary_cluster <- plot_data_modules %>% 
  group_by(pathway, key_group, cluster_label_sub, cluster_label_super) %>% 
  summarise(mean_score = mean(value, na.rm = T)) %>% 
  ungroup %>% 
  mutate(cluster_number = as.numeric(cluster_label_sub))
common_heat_layers <- list(
  scale_fill_gradient2(low = scales::muted("blue"), high = scales::muted("red"), 
                       na.value = "grey10", 
                       # breaks = c(-cut_value, 0, cut_value), 
                       # labels = c(paste0("≤-", cut_value), "0", paste0("≥", cut_value)),
                       # limits = c(-cut_value, cut_value)
                       ),
  theme(axis.text.x = element_text(angle = 90, hjust = 1, vjust = 0.5),
        axis.ticks = element_blank(),
        axis.line = element_blank(),
        axis.title = element_blank(),
        plot.margin = margin(0, 0, 0, 0),
        strip.text = element_blank())
)

pw_plot1 <- plot_data_modules_summary_cluster %>% 
  filter(key_group == "pathway") %>% 
  ggplot() +
  geom_tile(aes(cluster_label_sub, pathway, fill = mean_score)) +
  common_heat_layers +
  facet_grid(~cluster_label_super, scales = "free", space = "free") + 
  labs(x = "Cluster", y = "Pathway", fill = "Mean\nPROGENy\nscore") +
  scale_fill_gradient2(low = scales::muted("blue"), high = scales::muted("red"), 
                       # labels = c(paste0("≤-", cut_value), "0", paste0("≥", cut_value)),
                       # breaks = c(-cut_value, 0, cut_value), 
                       na.value = "grey10") +
  theme(axis.text.x = element_blank())

pw_plot2 <- plot_data_modules_summary_cluster %>% 
  filter(key_group == "module") %>% 
  ggplot() +
  geom_tile(aes(cluster_label_sub, pathway, fill = mean_score)) +
  common_heat_layers +
  facet_grid(~cluster_label_super, scales = "free", space = "free") + 
  labs(x = "Cluster", y = "Module", fill = "\n\n\nMean\nmodule\nscore") +
  scale_fill_gradient2(low = scales::muted("blue"), high = scales::muted("red"), 
                       # labels = c(paste0("≤-", cut_value), "0", paste0("≥", cut_value)),
                       # breaks = c(-cut_value, 0, cut_value), 
                       na.value = "grey10") +
  theme(axis.text.x = element_blank())

pw_plot1_anno <- plot_data_modules_summary_cluster %>% 
  distinct(cluster_label_sub, cluster_number, cluster_label_super) %>% 
  mutate(facet_helper = "") %>% 
  ggplot() +
  geom_tile(aes(cluster_label_sub, facet_helper, fill = cluster_label_sub)) +
  geom_point(aes(cluster_label_sub, facet_helper), color = "white", size = 6, alpha = 0.5) +
  geom_text(aes(cluster_label_sub, facet_helper, label = cluster_number)) +
  common_heat_layers + 
  scale_fill_manual(values = clrs$cluster_label_sub[[coi]]) +
  facet_grid(~cluster_label_super, scales = "free", space = "free") +
  theme(axis.text.y = element_blank(),
        strip.text = element_blank()) +
  guides(fill = F)

heat_module_grid <- plot_grid(pw_plot1, pw_plot2, pw_plot1_anno, rel_heights = c(0.45, 0.15, 0.4), ncol = 1, align = "v", axis = "lrtb")

heat_module_grid

ggsave("_fig/004_T_cell/004_module_heatmap.pdf", heat_module_grid, width = 12, height = 6.5)

0.3 marker heatmap

plot_data_markers <- as_tibble(FetchData(seu_obj_sub, c(myfeatures, unique(marker_tbl_top$gene)))) %>% 
  gather(gene, value, -c(1:(length(myfeatures)+1))) %>% 
  left_join(meta_tbl, by = "sample") %>% 
  mutate(cluster_label_sub = ordered(cluster_label_sub, levels = my_subtypes)) %>% 
  group_by(cluster_label_sub, gene) %>% 
  summarise(value = mean(value, na.rm = T)) %>% 
  group_by(gene) %>% 
  mutate(value = scales::rescale(value)) %>% 
  left_join(select(marker_tbl_top, cluster_label_sub_x = cluster_label_sub, gene), by = "gene") %>% 
  mutate(cluster_label_sub_x = ordered(cluster_label_sub_x, levels = rev(names(clrs$cluster_label_sub[[coi]])))) %>% 
  na.omit()
highlight_genes <- marker_tbl_top %>% 
  group_by(cluster_label_sub) %>% 
  slice(1:2) %>% 
  mutate(cluster_label_sub_x = ordered(cluster_label_sub, levels = rev(names(clrs$cluster_label_sub[[coi]])))) %>% 
  ungroup() %>% 
  select(cluster_label_sub_x, gene) %>% 
  na.omit %>% 
  mutate(highlight = T)

plot_data_markers_mat <- plot_data_markers %>% 
  spread(cluster_label_sub, value) %>% 
  left_join(highlight_genes, by = c("gene", "cluster_label_sub_x")) %>% 
  arrange(desc(cluster_label_sub_x), gene) %>% 
  select(cluster_label_sub_x, gene, highlight, everything())

ha_row <- rowAnnotation(
  `Cell type` = plot_data_markers_mat$cluster_label_sub_x,
  col = list(`Cell type` = clrs$cluster_label_sub[[coi]]),
  show_legend = F,
  annotation_name_side = "bottom"
)

ha_col <- columnAnnotation(
  `Cell type` = anno_block(gp = gpar(fill = clrs$cluster_label_sub[[coi]], col = NA),
                           labels = as.character(1:(ncol(plot_data_markers_mat)-3)),
                           labels_rot = 90),
  show_legend = F,
  annotation_name_side = "left",
  annotation_name_rot = 0
)

gene_idx <- plot_data_markers_mat$highlight == TRUE

ha_genes <- rowAnnotation(
  link = anno_mark(
    at = which(gene_idx),
    labels = plot_data_markers_mat$gene[which(gene_idx)],
    labels_gp = gpar(fontsize = 10), padding = unit(1, "mm"),
    side = "left",
    labels_rot = 180
  )
)

marker_heatmap <- Heatmap(
  as.matrix(plot_data_markers_mat[,-c(1:3)]), 
  heatmap_legend_param = list(
    title = "Scaled expression", 
    title_position = "leftcenter-rot"
  ),
  row_order = 1:length(plot_data_markers_mat$cluster_label_sub_x),
  row_split = plot_data_markers_mat$cluster_label_sub_x, 
  column_split = 1:length(colnames(plot_data_markers_mat)[-c(1:3)]),
  column_order = colnames(plot_data_markers_mat)[-c(1:3)], 
  column_names_side = "bottom",
  right_annotation = ha_row,
  left_annotation = ha_genes,
  bottom_annotation = ha_col,
  cluster_rows = F, 
  row_title = NULL,
  column_title = NULL,
  col = viridis(9)
)

# marker_heatmap

0.4 composition

0.4.1 per site

source("_src/comp_plot.R")

comp_tbl_sample_sort <- plot_data_sub %>%
  filter(therapy == "pre-Rx", consensus_signature != "Undetermined") %>%
  group_by(sample, tumor_subsite, tumor_supersite, tumor_megasite, patient_id_short,
           therapy, sort_short_x, consensus_signature, cluster_label_sub) %>%
  tally %>%
  group_by(sample, tumor_subsite, tumor_supersite, tumor_megasite, patient_id_short,
           therapy, sort_short_x, consensus_signature) %>%
  mutate(nrel = n/sum(n)*100,
         log10n = log10(n)) %>%
  mutate(sample_id = sample) %>%
  mutate(tumor_supersite = ordered(tumor_supersite, levels = rev(names(clrs$tumor_supersite)))) %>% 
  ungroup %>% 
  mutate(cell_type_naive = ifelse(str_detect(cluster_label_sub, "mem"), "T memory", "other")) %>% 
  mutate(cell_type_dysfunc = ifelse(str_detect(cluster_label_sub, "dysfunc"), "T dysfunctional", "other"))

plist1 <- default_comp_grid_list(
  comp_tbl_sample_sort, cell_type_naive, "T memory",
  cluster_label_sub, super_type_sub = "T.super", vec_plot = T, nmax = 5000)

plist2 <- default_comp_grid_list(
  comp_tbl_sample_sort, cell_type_dysfunc, "T dysfunctional",
  cluster_label_sub, super_type_sub = "T.super", vec_plot = T, nmax = 5000)

comp_grid1 <- plot_grid(plotlist = plist1, ncol = 1, align = "v", rel_heights = c(0.1, 0.1, 0.15, 0.2, 0.45))

comp_grid2 <- plot_grid(plotlist = plist2, ncol = 1, align = "v", rel_heights = c(0.1, 0.1, 0.15, 0.2, 0.45))

comp_grid1

comp_grid2

ggsave("_fig/004_T_cell/004_T.cell_comp_memory.pdf", comp_grid1, width = 3, height = 9)
ggsave("_fig/004_T_cell/004_T.cell_comp_dysfunc.pdf", comp_grid2, width = 3, height = 9)
heatmap_grob <- grid.grabExpr(draw(marker_heatmap), width = 8, height = 16)
vp_outer <- viewport(x = 0.5, y = 0.5, width = 0.5, height = 2, angle = 270)
vp_inner <- viewport(x = 0.5, y = 0.5, width = 1, height = 1, angle = 0)
grid.newpage()
pushViewport(vp_outer)
grid.draw(heatmap_grob)
popViewport(1)

heatmap_grob_rot <- grid.grab()

umap_heat_grid <- ggdraw() +
  draw_plot(add_umap_coord(umap_cell_type_void, size = 3.5, x = 0),
            x = 0, y = 0.5, width = 0.2, height = 0.5) +
  draw_plot(add_umap_coord(umap_site_void, size = 3.5, x = 0),
            x = 0, y = 0, width = 0.2, height = 0.5) +
  draw_grob(heatmap_grob_rot,
            x = 0.2, y = 0, width = 0.8, height = 1)
  # draw_plot_label(c("A", "B", "C", "D"), x = c(0, 0.63, 0, 0), y = c(0.995, 0.995, 0.72, 0.45))

umap_heat_grid

ggsave("_fig/004_T_cell/004_T.cell_umap_heat.png", umap_heat_grid, width = 20, height = 8)
ggsave("_fig/004_T_cell/004_T.cell_umap_heat.pdf", umap_heat_grid, width = 20, height = 8)

1 session info

devtools::session_info()
## ─ Session info ───────────────────────────────────────────────────────────────
##  setting  value                       
##  version  R version 3.6.2 (2019-12-12)
##  os       Debian GNU/Linux 10 (buster)
##  system   x86_64, linux-gnu           
##  ui       X11                         
##  language (EN)                        
##  collate  en_US.UTF-8                 
##  ctype    en_US.UTF-8                 
##  tz       Etc/UTC                     
##  date     2021-03-09                  
## 
## ─ Packages ───────────────────────────────────────────────────────────────────
##  package        * version    date       lib
##  ape              5.3        2019-03-17 [2]
##  assertthat       0.2.1      2019-03-21 [2]
##  backports        1.1.10     2020-09-15 [1]
##  beeswarm         0.2.3      2016-04-25 [2]
##  bibtex           0.4.2.2    2020-01-02 [2]
##  Biobase          2.46.0     2019-10-29 [2]
##  BiocGenerics     0.32.0     2019-10-29 [2]
##  bitops           1.0-6      2013-08-17 [2]
##  broom            0.7.2      2020-10-20 [1]
##  Cairo            1.5-12.2   2020-07-07 [1]
##  callr            3.4.2      2020-02-12 [1]
##  caTools          1.17.1.4   2020-01-13 [2]
##  cellranger       1.1.0      2016-07-27 [2]
##  circlize         0.4.10     2020-06-15 [1]
##  cli              2.0.2      2020-02-28 [1]
##  clue             0.3-57     2019-02-25 [1]
##  cluster          2.1.0      2019-06-19 [3]
##  codetools        0.2-16     2018-12-24 [3]
##  colorblindr    * 0.1.0      2020-01-13 [2]
##  colorspace     * 1.4-2      2019-12-29 [2]
##  ComplexHeatmap * 2.2.0      2019-10-29 [1]
##  cowplot        * 1.0.0      2019-07-11 [2]
##  crayon           1.3.4      2017-09-16 [1]
##  data.table       1.12.8     2019-12-09 [2]
##  DBI              1.1.0      2019-12-15 [2]
##  dbplyr           2.0.0      2020-11-03 [1]
##  desc             1.2.0      2018-05-01 [2]
##  devtools         2.2.1      2019-09-24 [2]
##  digest           0.6.25     2020-02-23 [1]
##  dplyr          * 1.0.2      2020-08-18 [1]
##  ellipsis         0.3.1      2020-05-15 [1]
##  evaluate         0.14       2019-05-28 [2]
##  fansi            0.4.1      2020-01-08 [2]
##  farver           2.0.3      2020-01-16 [1]
##  fitdistrplus     1.0-14     2019-01-23 [2]
##  forcats        * 0.5.0      2020-03-01 [1]
##  fs               1.5.0      2020-07-31 [1]
##  future           1.15.1     2019-11-25 [2]
##  future.apply     1.4.0      2020-01-07 [2]
##  gbRd             0.4-11     2012-10-01 [2]
##  gdata            2.18.0     2017-06-06 [2]
##  generics         0.0.2      2018-11-29 [2]
##  GetoptLong       1.0.2      2020-07-06 [1]
##  ggbeeswarm       0.6.0      2017-08-07 [2]
##  ggplot2        * 3.3.2      2020-06-19 [1]
##  ggrastr          0.1.9      2020-06-20 [1]
##  ggrepel          0.8.1      2019-05-07 [2]
##  ggridges         0.5.2      2020-01-12 [2]
##  GlobalOptions    0.1.2      2020-06-10 [1]
##  globals          0.12.5     2019-12-07 [2]
##  glue             1.3.2      2020-03-12 [1]
##  gplots           3.0.1.2    2020-01-11 [2]
##  gridExtra        2.3        2017-09-09 [2]
##  gtable           0.3.0      2019-03-25 [2]
##  gtools           3.8.1      2018-06-26 [2]
##  haven            2.3.1      2020-06-01 [1]
##  hms              0.5.3      2020-01-08 [1]
##  htmltools        0.5.1.1    2021-01-22 [1]
##  htmlwidgets      1.5.1      2019-10-08 [2]
##  httr             1.4.2      2020-07-20 [1]
##  ica              1.0-2      2018-05-24 [2]
##  igraph           1.2.5      2020-03-19 [1]
##  irlba            2.3.3      2019-02-05 [2]
##  jsonlite         1.7.1      2020-09-07 [1]
##  KernSmooth       2.23-16    2019-10-15 [3]
##  knitr            1.26       2019-11-12 [2]
##  labeling         0.3        2014-08-23 [2]
##  lattice          0.20-38    2018-11-04 [3]
##  lazyeval         0.2.2      2019-03-15 [2]
##  leiden           0.3.1      2019-07-23 [2]
##  lifecycle        0.2.0      2020-03-06 [1]
##  listenv          0.8.0      2019-12-05 [2]
##  lmtest           0.9-37     2019-04-30 [2]
##  lsei             1.2-0      2017-10-23 [2]
##  lubridate        1.7.9.2    2020-11-13 [1]
##  magrittr       * 2.0.1      2020-11-17 [1]
##  MASS             7.3-51.5   2019-12-20 [3]
##  Matrix           1.2-18     2019-11-27 [3]
##  memoise          1.1.0      2017-04-21 [2]
##  metap            1.2        2019-12-08 [2]
##  mnormt           1.5-5      2016-10-15 [2]
##  modelr           0.1.8      2020-05-19 [1]
##  multcomp         1.4-12     2020-01-10 [2]
##  multtest         2.42.0     2019-10-29 [2]
##  munsell          0.5.0      2018-06-12 [2]
##  mutoss           0.1-12     2017-12-04 [2]
##  mvtnorm          1.0-12     2020-01-09 [2]
##  nlme             3.1-143    2019-12-10 [3]
##  npsurv           0.4-0      2017-10-14 [2]
##  numDeriv         2016.8-1.1 2019-06-06 [2]
##  pbapply          1.4-2      2019-08-31 [2]
##  pillar           1.4.6      2020-07-10 [1]
##  pkgbuild         1.0.6      2019-10-09 [2]
##  pkgconfig        2.0.3      2019-09-22 [1]
##  pkgload          1.0.2      2018-10-29 [2]
##  plotly           4.9.1      2019-11-07 [2]
##  plotrix          3.7-7      2019-12-05 [2]
##  plyr             1.8.5      2019-12-10 [2]
##  png              0.1-7      2013-12-03 [2]
##  prettyunits      1.1.1      2020-01-24 [1]
##  processx         3.4.2      2020-02-09 [1]
##  ps               1.3.2      2020-02-13 [1]
##  purrr          * 0.3.4      2020-04-17 [1]
##  R.methodsS3      1.7.1      2016-02-16 [2]
##  R.oo             1.23.0     2019-11-03 [2]
##  R.utils          2.9.2      2019-12-08 [2]
##  R6               2.4.1      2019-11-12 [1]
##  RANN             2.6.1      2019-01-08 [2]
##  rappdirs         0.3.1      2016-03-28 [2]
##  RColorBrewer     1.1-2      2014-12-07 [2]
##  Rcpp             1.0.4      2020-03-17 [1]
##  RcppAnnoy        0.0.16     2020-03-08 [1]
##  RcppParallel     4.4.4      2019-09-27 [2]
##  Rdpack           0.11-1     2019-12-14 [2]
##  readr          * 1.4.0      2020-10-05 [1]
##  readxl         * 1.3.1      2019-03-13 [2]
##  remotes          2.1.0      2019-06-24 [2]
##  reprex           0.3.0      2019-05-16 [2]
##  reshape2         1.4.3      2017-12-11 [2]
##  reticulate       1.14       2019-12-17 [2]
##  rjson            0.2.20     2018-06-08 [1]
##  rlang            0.4.8      2020-10-08 [1]
##  rmarkdown        2.0        2019-12-12 [2]
##  ROCR             1.0-7      2015-03-26 [2]
##  rprojroot        1.3-2      2018-01-03 [2]
##  rstudioapi       0.11       2020-02-07 [1]
##  rsvd             1.0.3      2020-02-17 [1]
##  Rtsne            0.15       2018-11-10 [2]
##  rvest            0.3.6      2020-07-25 [1]
##  sandwich         2.5-1      2019-04-06 [2]
##  scales           1.1.0      2019-11-18 [2]
##  sctransform      0.2.1      2019-12-17 [2]
##  SDMTools         1.1-221.2  2019-11-30 [2]
##  sessioninfo      1.1.1      2018-11-05 [2]
##  Seurat         * 3.1.2      2019-12-12 [2]
##  shape            1.4.4      2018-02-07 [1]
##  sn               1.5-4      2019-05-14 [2]
##  stringi          1.5.3      2020-09-09 [1]
##  stringr        * 1.4.0      2019-02-10 [1]
##  survival         3.1-8      2019-12-03 [3]
##  testthat         2.3.2      2020-03-02 [1]
##  TFisher          0.2.0      2018-03-21 [2]
##  TH.data          1.0-10     2019-01-21 [2]
##  tibble         * 3.0.4      2020-10-12 [1]
##  tidyr          * 1.1.2      2020-08-27 [1]
##  tidyselect       1.1.0      2020-05-11 [1]
##  tidyverse      * 1.3.0      2019-11-21 [2]
##  tsne             0.1-3      2016-07-15 [2]
##  usethis          1.5.1      2019-07-04 [2]
##  uwot             0.1.5      2019-12-04 [2]
##  vctrs            0.3.5      2020-11-17 [1]
##  vipor            0.4.5      2017-03-22 [2]
##  viridis        * 0.5.1      2018-03-29 [2]
##  viridisLite    * 0.3.0      2018-02-01 [2]
##  withr            2.3.0      2020-09-22 [1]
##  xfun             0.12       2020-01-13 [2]
##  xml2             1.3.2      2020-04-23 [1]
##  yaml             2.2.1      2020-02-01 [1]
##  zoo              1.8-7      2020-01-10 [2]
##  source                                 
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.3)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  Bioconductor                           
##  Bioconductor                           
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.3)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  Github (clauswilke/colorblindr@1ac3d4d)
##  R-Forge (R 3.6.2)                      
##  Bioconductor                           
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.3)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.3)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.3)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.3)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  Bioconductor                           
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.3)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.3)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.3)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.3)                         
##  CRAN (R 3.6.3)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.3)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
##  CRAN (R 3.6.2)                         
## 
## [1] /home/uhlitzf/R/lib
## [2] /usr/local/lib/R/site-library
## [3] /usr/local/lib/R/library